package com.djp.smartapp;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.djp.smartapp.dialog.OnClickManager;
import com.djp.smartapp.dialog.MyDialog;
import com.lenovo.manufacture.R;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private Button btnCreateLine;
    private Button btnGetPeople;
    private Button btnBuyMaterial;
    private Button btnAddMaterial;
    private Button btnRun;
    private Button btnNextStep;
    private TextView tvNowStepNum;
    private TextView tvNowStepName;
    private TextView tvNowStepHp;
    private MainActivity context = this;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        btnCreateLine = findViewById(R.id.btn_create_line);
        btnGetPeople = findViewById(R.id.btn_get_people);
        btnBuyMaterial = findViewById(R.id.btn_buy_material);
        btnAddMaterial = findViewById(R.id.btn_add_material);
        btnRun = findViewById(R.id.btn_run);
        btnNextStep = findViewById(R.id.btn_next_step);
        tvNowStepNum = findViewById(R.id.tv_now_step_num);
        tvNowStepName = findViewById(R.id.tv_now_step_name);
        tvNowStepHp = findViewById(R.id.tv_now_step_hp);

        btnCreateLine.setOnClickListener(this);
        btnGetPeople.setOnClickListener(this);
        btnBuyMaterial.setOnClickListener(this);
        btnAddMaterial.setOnClickListener(this);
        btnRun.setOnClickListener(this);
        btnNextStep.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        MyDialog myDialog = OnClickManager.getOnClickManager().getMyDialog(view, context);
        myDialog.show();
    }
}